#include<stdio.h>
FILE *fpinp=fopen("BANDW.INP","r");
FILE *fpout=fopen("BANDW.OUT","w");
long x1,y1,x2,y2;
int i,t;
void input(){
    fscanf(fpinp,"%ld%ld%ld%ld",&x1,&y1,&x2,&y2);
    if(x1>x2)x1^=x2^=x1^=x2;
    if(y1>y2)y1^=y2^=y1^=y2;
}
long min(long a,long b){
    return a>b?b:a;
}
long maxWith0(long x){
    return x>0?x:0;
}
long getC(){
    if(x1>y1){
        if(x1>y2)return 0;
        else return min(y2-x1,x2-x1);
    }else{
        if(y1>x2)return 0;
        else return min(x2-y1,y2-y1);
    }
}
int main(){
    fscanf(fpinp,"%d",&t);
    for(i=1;i<=t;i++){
        input();
        fprintf(fpout,"%ld",maxWith0((x2-x1-1)*(y2-y1-1)-getC()+1));
        if(i<t)fprintf(fpout,"\n");
    }
    fclose(fpinp);
    fclose(fpout);
    return 0;
}
